﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
using Mysql_Planer;

namespace Planer
{
    public partial class Setting : Form
    {
        public Setting()
        {
            InitializeComponent();
            string strConn = My_planer.sql_config;
            using (MySqlConnection conn = new MySqlConnection(strConn))
            {
                conn.Open();
                string sql = "SELECT CD_CODE, CD_COMMENT FROM CODE_DEFINE;";
                MySqlCommand cmd = new MySqlCommand(sql, conn);

                MySqlDataReader rdr = cmd.ExecuteReader();

                while (rdr.Read())
                {
                    string combo_add = rdr.GetString(0) + " : " + rdr.GetString(1) ;
                    CB_CodeList.Items.Add(combo_add); 
                }
                conn.Close();
            }
        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }
    }
}
